var search = function(config){
	var that = {
		conf:{
			regexp:"[\\d]+",
			source:null
		},
		toJson:function(val){
			val = val.replace(/[\r]/g,'').replace(/[\n]/g,'');
			return (new Function("return " + val))() || {};
		},
		tmpsource:{
			str:null,
			map:null,
			tplist:[]
		},
		init:function(conf){
			//初始化配置
			for(var item in conf){
				that.conf[item] = conf[item];
			}
			//反序列化数据存储到临时数据区
			that.tmpsource.map = that.toJson(that.conf.source || "{}");
			//构建结构化字符串
			for(var item in that.tmpsource.map){
				that.tmpsource.tplist.push(item);
			}
			that.tmpsource.str = that.tmpsource.tplist.join("|");
			that.tmpsource.tplist = null;
		}
	};
	that.init(config);
	return {
		select:function(fdstr,top){
			var reg = new RegExp("("+ that.conf.regexp + fdstr + that.conf.regexp + "|)","g"),
				tmp = that.tmpsource.str.match(reg),
				list = [];
			for(var i = 0,j = 0,len = tmp.length,jlen = top ? top : len; i < len && j < jlen; i++){
				if(tmp[i] != ""){
					list.push(that.tmpsource.map[tmp[i]]);
					j++;
				}
			}
			return list;
		}
	}
};